package cn.itcast.dao;

import cn.itcast.domain.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AccountDao {

    @Select("select * from account")
    List<Account> findAll();

    @Delete("delete from account where id=#{id}")
    int delete(Integer id)throws Exception;

    @Update("update account set id=#{id},name=#{name},money=#{money}")
    int update(Account account)throws Exception;

    @Insert("insert into account(id,name,money) values (#{id},#{name},#{money})")
    int add(Account account)throws Exception;
}
